package com.blackcat.starter.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @Title 配置属性类
 * @Description 读取 blackcat.server 前缀的配置项。
 * @author zhanghui
 * @date 2020年07月27日 14:00
 * @version V1.0
 * @see 
 * @since V1.0
 */
@Component
@PropertySource("classpath:application.yml")
@ConfigurationProperties(prefix = "blackcat.server")
public class BlackCatProperties {

	/** 默认端口 */
	private static final Integer DEFAULT_PORT = 8000;

	/** 端口 */
	private Integer port = DEFAULT_PORT;

	public static Integer getDefaultPort() {
		return DEFAULT_PORT;
	}

	public Integer getPort() {
		return port;
	}

	public BlackCatProperties setPort(Integer port) {
		this.port = port;
		return this;
	}
}
